package Router

import(
	"github.com/gin-gonic/gin"
	"gin/Services"
	"gin/Middlewares"
)

func InitRouter() {
	r := gin.Default()
	r.Use(Middlewares.Cors())
	r.GET("/api/display_code_data", Services.DisplayCodeData)
	r.GET("/api/display_suggest", Services.DisplaySuggest)
	r.GET("/api/display_overall", Services.DisplayOverall)
	r.GET("/api/display_market", Services.DisplayMarket)
	r.GET("/api/display_susong", Services.DisplaySusong)
	r.GET("/api/display_chufa", Services.DisplayChufa)
	r.GET("/api/display_tiaojia", Services.DisplayTiaojia)
	r.GET("/api/display_diaoyan", Services.DisplayDiaoyan)
	r.GET("/api/display_chanyelian", Services.DisplayChanyelian)
	r.GET("/api/display_guanli", Services.DisplayGuanli)
	r.GET("/api/display_yeji", Services.DisplayYeji)
	r.GET("/api/display_other", Services.DisplayOther)
	r.GET("/api/display_continuous_overall", Services.DisplayContinuousOverall)
	r.GET("/api/display_continuous_market", Services.DisplayContinuousMarket)
	r.GET("/api/login", Services.Login)
	r.GET("/api/display_all", Services.DisplayAll)
	r.GET("/api/display_market_old", Services.DisplayMarketOld)
	r.GET("/api/display_market_new", Services.DisplayMarketNew)
	r.GET("/api/display_overall_old", Services.DisplayOverallOld)
    r.GET("/api/display_overall_new", Services.DisplayOverallNew)

	r.GET("/api/overall_for_check", Services.OverallDataForCheck)
	r.GET("/api/overall_confirm", Services.OverallDataConfirm)
	r.GET("/api/overall_delete", Services.OverallDataDelete)
	r.GET("/api/overall_update", Services.OverallDataUpdate)
	r.GET("/api/overall_add", Services.OverallDataAdd)

	r.GET("/api/market_data_for_check", Services.MarketDataForCheck)
	r.GET("/api/market_data_confirm", Services.MarketDataConfirm)
	r.GET("/api/market_data_delete", Services.MarketDataDelete)
	r.GET("/api/market_data_update", Services.MarketDataUpdate)
	r.GET("/api/market_data_add", Services.MarketDataAdd)

	r.GET("/api/attr_data_for_check", Services.AttrDataForCheck)
	r.GET("/api/attr_data_confirm", Services.AttrDataConfirm)
	r.GET("/api/attr_data_delete", Services.AttrDataDelete)
	r.GET("/api/attr_data_update", Services.AttrDataUpdate)
	r.GET("/api/attr_data_add", Services.AttrDataAdd)

	r.GET("/api/continuous_overall_add", Services.ContinuousOverallDataAdd)
	r.GET("/api/market_continuous_add", Services.ContinuousMarketDataAdd)

	r.POST("/api/entity_data_add", Services.EntityDataAdd)
	r.POST("/api/entity_data_suggest", Services.EntityDataSuggest)
	r.GET("/api/entity_data_query", Services.EntityDataQuery)
	r.POST("/api/custom_task_add", Services.CustomTaskAdd)
	r.GET("/api/display_entity_list", Services.DisplayEntityList)
	r.GET("/api/display_entity_detail", Services.DisplayEntityDetail)
	r.GET("/api/display_entity_suggest", Services.DisplayEntitySuggest)
	r.GET("/api/display_entity_search", Services.DisplayEntitySearch)
	r.GET("/api/display_task", Services.DisplayTask)
	r.POST("/api/display_task_detail", Services.DisplayTaskDetail)
	r.GET("/api/display_task_by_class", Services.DisplayTaskByClass)
	r.GET("/api/display_task_by_user", Services.DisplayTaskByUser)
	r.GET("/api/display_entity_list_by_user", Services.DisplayEntityListByUser)

	r.Run(":8082")	
}
